package com.cmccgz.udacs_landlord_webapp.base;

import android.app.Application;
import android.content.Context;

import com.bilibili.boxing.BoxingCrop;
import com.bilibili.boxing.BoxingMediaLoader;
import com.bilibili.boxing.loader.IBoxingMediaLoader;
import com.cmccgz.baselibrary.bilibili.BoxingGlide4Loader;
import com.cmccgz.baselibrary.bilibili.BoxingUcrop;
import com.orhanobut.logger.LogLevel;
import com.orhanobut.logger.Logger;

/**
 * @author: Huang
 * @Descripion:
 * @date 2017/5/23 15:40
 */

public class GlobalContext extends Application {

    private static GlobalContext globalContext = null;

    @Override
    public void onCreate() {
        super.onCreate();
        GlobalContext.globalContext = this;
        Logger.init(AppConfig.TAG).logLevel(LogLevel.FULL);
//        推送初始化
//        JPushInterface.setDebugMode(true);
//        JPushInterface.init(this);
        //初始化图片选择器
        IBoxingMediaLoader loader = new BoxingGlide4Loader();
        BoxingMediaLoader.getInstance().init(loader);
        BoxingCrop.getInstance().init(new BoxingUcrop());
    }

    public static Context getInstance(){
        return GlobalContext.globalContext.getApplicationContext();
    }

}
